package entity

import "time"

type User struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
}

type Resp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func RespHandle(code int, msg string, data any) Resp {
	return Resp{code, msg, data}
}

//hertz query tag

type Person struct {
	Name    string `query:"name" json:"name" url:"name,required"`
	Age     int    `query:"age" json:"age" url:"age"`
	Address string `query:"address" json:"address" url:"address"`
}
type PersonAll struct {
	Name       string    `form:"name" json:"name" url:"name" msgpack:"name"`
	Address    string    `form:"address" json:"address" url:"address" msgpack:"address"`
	Birthday   time.Time `form:"birthday" time_format:"2006-01-02" time_utc:"1" json:"birthday" url:"birthday" msgpack:"birthday"`
	CreateTime time.Time `form:"createTime" time_format:"unixNano" json:"create_time" url:"create_time" msgpack:"createTime"`
	UnixTime   time.Time `form:"unixTime" time_format:"unix" json:"unix_time" url:"unix_time" msgpack:"unixTime"`
}
